home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / termsorc.lha / Extras / Source / gtlayout-source.lha / LT_NewMenuTemplate.c < prev    next >
C/C++ Source or Header  |  1995-09-24  |  975b  |  51 lines

  1. /*  GadTools layout toolkit
  2. **
  3. **  Copyright © 1993-1995 by Olaf `Olsen' Barthel
  4. **  Freely distributable.
  5. **
  6. **  :ts=4
  7. */
  8.  
  9. #include "gtlayout_global.h"
  10.  
  11. #ifdef DO_MENUS
  12.  
  13.     /* LT_NewMenuTemplate():
  14.      *
  15.      *    Create a new menu, based on the Screen, Font and template given.
  16.      */
  17.  
  18. struct Menu * LIBENT
  19. LT_NewMenuTemplate(REG(a0) struct Screen *Screen,REG(a1) struct TextAttr *TextAttr,REG(a2) struct Image *AmigaGlyph,REG(a3) struct Image *CheckGlyph,REG(d0) LONG *Error,REG(d1) struct NewMenu *MenuTemplate)
  20. {
  21.     if(MenuTemplate)
  22.     {
  23.         RootMenu    *Root;
  24.         LONG         ErrorValue;
  25.  
  26.         if(!Error)
  27.             Error = &ErrorValue;
  28.  
  29.         if(Root = LTP_NewMenu(Screen,TextAttr,AmigaGlyph,CheckGlyph,Error))
  30.         {
  31.                 // Create the menu
  32.  
  33.             if(LTP_CreateMenuTemplate(Root,Error,MenuTemplate))
  34.             {
  35.                     // Do the layout
  36.  
  37.                 if(LTP_LayoutMenu(Root,2,2))
  38.                     return(&Root -> Menu);
  39.                 else
  40.                     *Error = ERROR_DISK_FULL;
  41.             }
  42.  
  43.             LT_DisposeMenu(&Root -> Menu);
  44.         }
  45.     }
  46.  
  47.     return(NULL);
  48. }
  49.  
  50. #endif    /* DO_MENUS */
  51.